package cn.lijiajia3515.cairo.auth.modules.role;

import cn.lijiajia3515.cairo.core.tree.TreeNode;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Accessors(chain = true)
public class RoleTreeNode implements TreeNode<String, RoleTreeNode>, Serializable {

	/**
	 * id
	 */
	private String id;

	/**
	 * parent
	 */
	private String parent;

	/**
	 * 角色名
	 */
	private String name;

	/**
	 * 排序
	 */
	private Long sort;

	private List<RoleTreeNode> subs = new ArrayList<>(1);

	@Override
	public String id() {
		return id;
	}

	@Override
	public String parent() {
		return parent;
	}

	@Override
	public List<RoleTreeNode> subs() {
		return subs;
	}

	@Override
	public void subs(List<RoleTreeNode> subs) {
		this.subs = subs;
	}
}
